<template>
  <div class="active">{{id}}</div>
</template>

<script lang="ts">
import { defineComponent, onMounted, reactive, toRefs } from 'vue'
import { useRoute } from 'vue-router'

export default defineComponent({
  setup() {
    const route = useRoute()
    const state = reactive({
      id: 'aaa',
    })

    onMounted(() => {
      state.id = route.query.id
    })

    return {
      ...toRefs(state),
    }
  },
})
</script>

<style lang="less" scoped>
.active {
  padding: 50px 0;
}
</style>